@extends('layout.home.master')
@section('content')
    <div class="container mt-4">
        <form action="{{route ('article.store')}}" method="post">
            @csrf
            <div class="card">
                <div class="card-header">
                    文章发布
                </div>
                <div class="card-body">
                    <div class="form-group">
                        <label for="">文章标题</label>
                        <input type="text" name="title" id="" class="form-control" placeholder="" aria-describedby="helpId">
                    </div>
                    <div class="form-group">
                        <label for="">文章内容</label>
                        <div id="editormd">
                            <textarea  name="content" id="editor" autofocus></textarea>
                        </div>
                    </div>
                </div>
                <div class="card-footer text-muted">
                    <button id="sub" class="btn btn-primary">提交</button>
                </div>
            </div>
        </form>
    </div>
@endsection
@push('js')
    <script type="text/javascript" src="{{asset('org/layui')}}/lay/layui.js"></script>
    <script>
        layui.use('layedit', function(){
            var layedit = layui.layedit;
            layedit.set({
                uploadImage: {
                    url: '{{route('upload.upload')}}' //接口url
                    ,type: '' //默认post
                }
            });
            layedit.build('editor'); //建立编辑器

        });

    </script>
    @endpush
@push('css')
    <link rel="stylesheet" type="text/css" href="{{asset('org/layui')}}/lay/css/layui.css" />
    @endpush
